]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
BluetoothMenu: show the submenu when active but not connected
authorGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 28 Jan 2014 20:47:37 +0000 (21:47 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 6 Feb 2014 18:07:48 +0000 (19:07 +0100)
Following the updated designs for system status, show the submenu
but not the indicator when bluetooth radio is on but no device
is connected.

https://bugzilla.gnome.org/show_bug.cgi?id=709353

js/ui/status/bluetooth.js

index a220d7b3c639fa671ee8987a03afc7fe4a9e24ca..920fbe26a4935acff5e37239ad48d3b1beb5c4b4 100644 (file)
@@ -38,7 +38,10 @@ const Indicator = new Lang.Class({
                                                      log(error.message);
                                                      return;
                                                  }
+
+                                                 this._sync();
                                              }));
+        this._proxy.connect('g-properties-changed', Lang.bind(this, this._sync));
 
         // The Bluetooth menu only appears when Bluetooth is in use,
         // so just statically build it with a "Turn Off" menu item.
@@ -90,11 +93,12 @@ const Indicator = new Lang.Class({
     _sync: function() {
         let nDevices = this._getNConnectedDevices();
 
-        let on = nDevices > 0;
-        this._indicator.visible = on;
-        this._item.actor.visible = on;
+        this._indicator.visible = nDevices > 0;
+        this._item.actor.visible = !this._proxy.BluetoothAirplaneMode;
 
-        if (on)
+        if (nDevices > 0)
             this._item.status.text = ngettext("%d Connected Device", "%d Connected Devices", nDevices).format(nDevices);
+        else
+            this._item.status.text = _("Not Connected");
     },
 });